home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / CTBUtilities.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  3.0 KB  |  138 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        CTBUtilities.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __CTBUTILITIES__
  13. #define __CTBUTILITIES__
  14.  
  15. #ifndef    __MEMORY__
  16. #include <Memory.h>
  17. #endif
  18.  
  19. #ifndef __STANDARDFILE__
  20. #include <StandardFile.h>
  21. #endif
  22.  
  23. #ifndef __APPLETALK__
  24. #include <AppleTalk.h>
  25. #endif
  26.  
  27.  
  28. enum {
  29.  
  30.  
  31. /*    version of Comm Toolbox Utilities    */
  32.  curCTBUVersion = 2,
  33.  
  34. /*    Error codes/types    */
  35.  ctbuGenericError = -1,
  36.  ctbuNoErr = 0
  37. };
  38.  
  39. typedef        OSErr    CTBUErr;
  40.  
  41. enum {chooseDisaster = -2,chooseFailed,chooseAborted,chooseOKMinor,chooseOKMajor,
  42.     chooseCancel};
  43. typedef unsigned short ChooseReturnCode;
  44.  
  45. enum {nlOk,nlCancel,nlEject};
  46. typedef unsigned short NuLookupReturnCode;
  47.  
  48. enum {nameInclude = 1,nameDisable,nameReject};
  49. typedef unsigned short NameFilterReturnCode;
  50.  
  51. enum {zoneInclude = 1,zoneDisable,zoneReject};
  52. typedef unsigned short ZoneFilterReturnCode;
  53.  
  54.  
  55. enum {
  56.  
  57.  
  58. /*    Values for hookProc items        */
  59.  hookOK = 1,
  60.  hookCancel = 2,
  61.  hookOutline = 3,
  62.  hookTitle = 4,
  63.  hookItemList = 5,
  64.  hookZoneTitle = 6,
  65.  hookZoneList = 7,
  66.  hookLine = 8,
  67.  hookVersion = 9,
  68.  hookReserved1 = 10,
  69.  hookReserved2 = 11,
  70.  hookReserved3 = 12,
  71.  hookReserved4 = 13,
  72.  
  73. /*    "virtual" hookProc items    */
  74.  hookNull = 100,
  75.  hookItemRefresh = 101,
  76.  hookZoneRefresh = 102,
  77.  hookEject = 103,
  78.  hookPreflight = 104,
  79.  hookPostflight = 105,
  80.  hookKeyBase = 1000
  81. };
  82.  
  83.  
  84. /*    NuLookup structures/constants    */
  85. struct NLTypeEntry {
  86.     Handle hIcon;
  87.     Str32 typeStr;
  88. };
  89.  
  90. typedef struct NLTypeEntry NLTypeEntry;
  91.  
  92.  
  93. typedef NLTypeEntry NLType[4];
  94.  
  95. struct NBPReply {
  96.     EntityName    theEntity;
  97.     AddrBlock    theAddr;
  98. };
  99.  
  100. typedef struct NBPReply NBPReply;
  101.  
  102.  
  103. typedef pascal short (*NameFilterProcPtr)(EntityName theEntity);
  104. typedef pascal short (*ZoneFilterProcPtr)(Str32 theZone);
  105.  
  106. typedef NameFilterProcPtr nameFilterProcPtr;
  107. typedef ZoneFilterProcPtr zoneFilterProcPtr;
  108.  
  109. #ifdef __cplusplus
  110. extern "C" {
  111. #endif
  112. pascal CTBUErr    InitCTBUtilities(void);
  113. pascal short     CTBGetCTBVersion(void);
  114.  
  115.  
  116. pascal short     StandardNBP(Point where,ConstStr255Param prompt,short numTypes,
  117.                     NLType typeList,NameFilterProcPtr nameFilter,ZoneFilterProcPtr zoneFilter,
  118.                     DlgHookProcPtr hookProc,NBPReply *theReply);
  119.  
  120. pascal short     CustomNBP(Point where,ConstStr255Param prompt,short numTypes,
  121.                     NLType typeList,NameFilterProcPtr nameFilter,ZoneFilterProcPtr zoneFilter,
  122.                     DlgHookProcPtr hookProc,long userData,short dialogID,ModalFilterProcPtr filterProc,
  123.                     NBPReply *theReply);
  124.  
  125. /*  Obsolete synonyms for above routines  */
  126. pascal short     NuLookup(Point where,ConstStr255Param prompt,short numTypes,
  127.                     NLType typeList,NameFilterProcPtr nameFilter,ZoneFilterProcPtr zoneFilter,
  128.                     DlgHookProcPtr hookProc,NBPReply *theReply);
  129.  
  130. pascal short     NuPLookup(Point where,ConstStr255Param prompt,short numTypes,
  131.                     NLType typeList,NameFilterProcPtr nameFilter,ZoneFilterProcPtr zoneFilter,
  132.                     DlgHookProcPtr hookProc,long userData,short dialogID,ModalFilterProcPtr filterProc,
  133.                     NBPReply *theReply);
  134. #ifdef __cplusplus
  135. }
  136. #endif
  137.  
  138. #endif